package com.tuanzi.loan.business.service.family.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tuanzi.loan.business.entity.family.ContentActivityVars;
import com.tuanzi.loan.business.repository.family.ContentActivityVarsRepository;
import com.tuanzi.loan.business.service.family.ContentActivityVarsService;
import com.tuanzi.loan.core.aspect.Debug;

import java.util.List;

@Debug
@Service
@Transactional
@Retryable(value = { RetryException.class })
public class ContentActivityVarsServiceImpl implements ContentActivityVarsService {

	@Autowired
	private ContentActivityVarsRepository contentActivityVarsRepository;

	@Override
	public void deleteAllByAid(Long aid) {
		contentActivityVarsRepository.deleteAllByAid(aid);
	}

	@Override
	public List<ContentActivityVars> findAllByAid(Long aid) {
		return contentActivityVarsRepository.findAllByAid(aid);
	}

	@Override
	public ContentActivityVars saveOrUpdate(ContentActivityVars contentActivityVars) {
		return contentActivityVarsRepository.save(contentActivityVars);
	}
}
